package FirstWeek;

import java.util.Random;

public class Sixth {
    public static void res(){
        int max = 0,min = 0,aver,sum = 0;


        Random random = new Random();

        int[] a = new int[20];

        for(int i = 0; i < 20; i++){
            a[i] = random.nextInt(458 - 77 + 1) + 77;
        }

        for(int i = 0; i < 20; i++){
            sum+=a[i];
            if(a[i] > max){
                max = a[i];
            }
            if(a[i] < min){
                min = a[i];
            }
        }
        aver = sum / 20;

        System.out.println("最大值：" + max +"\n" + "最小值：" + min +"\n" + "平均值：" + aver +"\n" + "各元素之和：" + sum +"\n");
    }
}
